//////////////////////////////////////////////////////////////////////////
//
// GAM203
// Cube class
// Cube.h
// 
// Grant Johnson
// Qantm College
// 27/10/2010
//
//////////////////////////////////////////////////////////////////////////

#ifndef CUBE_H
#define CUBE_H

#include "Drawable.h"

#include <d3d9.h>
#include <d3d9types.h>

class Cube : public Drawable
{
public:
	//Struct to define vertices
	struct VertexData
	{
		//Vertices have a position and a colour
		D3DVECTOR pos;
		D3DCOLOR col;
	};

	//Define the Flexible Vertex Format as a static const, that is capable of taking a 3d position and a colour
	static const DWORD VERTEX_FORMAT_FVF = D3DFVF_XYZ | D3DFVF_DIFFUSE;

	Cube();
	virtual ~Cube();

public:
	
	//////////////////////////////////////////////////////////////////////////
	// VIRTUAL - Inherited from Drawable
	// For creating the drawable object
	//
	// Paramaters:
	// a_pDevice, the direct3d device
	// a_pTexFileName, a path passed into the function. This can either be used for
	// the texture file name, or for a mesh's file name.
	//
	// Returns false if any step of the creation failed
	// Returns true if created successfully
	//
	//////////////////////////////////////////////////////////////////////////
	virtual bool CreateObject(IDirect3DDevice9* a_pDevice, char* a_pTexFileName);

	//////////////////////////////////////////////////////////////////////////
	// VIRTUAL - Inherited from Drawable
	// For rendering the drawable object
	//
	// Paramaters:
	// a_pDevice, the direct3d device
	//
	// Returns void
	//
	//////////////////////////////////////////////////////////////////////////
	virtual void Render(float a_dt, IDirect3DDevice9* a_pDevice, const RenderParams& a_renderParams);

	ID3DXMesh* GetMesh() const { return m_pMesh; }

	void SetSelected(bool a_val);


private:
	LPD3DXMESH m_pMesh;

	bool m_selected;
};

#endif //CUBE_H